package com.tuanzi.loan.business.service.compensation.impl;

import com.tuanzi.loan.business.entity.compensation.CompensationCompanyInfo;
import com.tuanzi.loan.business.repository.compensation.CompensationCompanyInfoRepository;
import com.tuanzi.loan.business.service.compensation.CompensationCompanyInfoService;
import com.tuanzi.loan.core.aspect.Debug;
import com.tuanzi.loan.core.repository.JPAAuditRepository;
import com.tuanzi.loan.core.service.BaseAuditServiceImpl;
import com.tuanzi.loan.core.vo.PageSearcher;
import com.tuanzi.loan.vo.request.compensation.CompensationCompanyInfoRequest;
import com.tuanzi.loan.vo.response.compensation.CompensationCompanyInfoResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.retry.RetryException;
import org.springframework.retry.annotation.Retryable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author caiwanlin
 * @create 2019-02-12 14:21
 */
@Debug
@Service
@Transactional
@Retryable(value = {RetryException.class})
public class CompensationCompanyInfoServiceImpl extends BaseAuditServiceImpl<CompensationCompanyInfo,Long> implements CompensationCompanyInfoService{
    @Autowired
    private CompensationCompanyInfoRepository compensationCompanyInfoRepository;
    @Override
    protected JPAAuditRepository<CompensationCompanyInfo, Long> getRepository() {
        return compensationCompanyInfoRepository;
    }

    @Override
    public Page<CompensationCompanyInfoResponse> list(PageSearcher<CompensationCompanyInfoRequest> pageSearcher) {
        return compensationCompanyInfoRepository.list(pageSearcher.getSearchCondition(),pageSearcher.getPageable());
    }
}
